{% extends "auth/base.html" %}
{% load i18n %}

{% block title %}{% trans "创建超级管理员" %}{% endblock %}

{% block body %}
<div class="login-box">
    <div class="login-logo">
        <a href="/"><b>DC</b>RM</a>
    </div>
    <div class="login-box-body">
        <p class="login-box-msg">{% trans "创建超级管理员账户" %}</p>
        <form method="post" class="form">
            {% csrf_token %}
            {% if form.non_field_errors %}
            <div class="alert alert-danger">
                {{ form.non_field_errors }}
            </div>
            {% endif %}

            <div class="form-group has-feedback {% if form.username.errors %}has-error{% endif %}">
                {{ form.username.label_tag}}
                {{ form.username }}
                <span class="glyphicon glyphicon-user form-control-feedback"></span>
                {% if form.username.errors %}
                <span class="help-block">{{ form.username.errors }}</span>
                {% endif %}
            </div>

            <div class="form-group has-feedback {% if form.email.errors %}has-error{% endif %}">
                {{ form.email.label_tag}}
                {{ form.email }}
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                {% if form.email.errors %}
                <span class="help-block">{{ form.email.errors }}</span>
                {% endif %}
            </div>

            <div class="form-group has-feedback {% if form.password1.errors %}has-error{% endif %}">
                {{ form.password1.label_tag}}
                {{ form.password1 }}
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                {% if form.password1.errors %}
                <span class="help-block">{{ form.password1.errors }}</span>
                {% endif %}
            </div>

            <div class="form-group has-feedback {% if form.password2.errors %}has-error{% endif %}">
                {{ form.password2.label_tag}}
                {{ form.password2 }}
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                {% if form.password2.errors %}
                <span class="help-block">{{ form.password2.errors }}</span>
                {% endif %}
            </div>

            <div class="row">
                <div class="col-xs-12">
                    <button type="submit" class="btn btn-primary btn-block btn-flat">{% trans "创建账户" %}</button>
                </div>
            </div>
        </form>
    </div>
</div>
{% endblock %}